summaryrefslogtreecommitdiff
path: root/frontend/app/drive/[...path]/page.tsx
blob: 69db5c47d644fbdeba48235bca03507e93b9b28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { DriveDirectoryView } from "@/components/drive/DriveDirectoryView"
import { Drive_ls } from "@/lib/drive_server"
import { fetchStorageData } from "@/lib/storage"

export default async function DriveDirectoryPage({
  params,
}: {
  params: Promise<{ path: string[] }>
}) {
  const { path: pathSegments } = await params
  // URL decode each path segment to handle special characters
  const decodedSegments = pathSegments?.map(segment => decodeURIComponent(segment)) || []
  const currentPath = '/' + decodedSegments.join('/')
  
  const [files, storageData] = await Promise.all([
    Drive_ls(currentPath, false),
    fetchStorageData()
  ])
  
  return <DriveDirectoryView path={currentPath} files={files} storageData={storageData} />
}